/*
Navicat SQL Server Data Transfer

Source Server         : LOLITA
Source Server Version : 120000
Source Host           : LOLITA\SQLEXPRESS:1433
Source Database       : EasyTicket
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 110000
File Encoding         : 65001

Date: 2014-09-10 12:20:08
*/


-- ----------------------------
-- Table structure for C001_COUNTRY
-- ----------------------------
DROP TABLE [C001_COUNTRY]
GO
CREATE TABLE [C001_COUNTRY] (
[CountryId] int NOT NULL IDENTITY(1000,1) ,
[CountryName] nvarchar(100) NOT NULL 
)


GO

-- ----------------------------
-- Records of C001_COUNTRY
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [C001_COUNTRY] ON
GO
SET IDENTITY_INSERT [C001_COUNTRY] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for C002_CITY
-- ----------------------------
DROP TABLE [C002_CITY]
GO
CREATE TABLE [C002_CITY] (
[CityId] int NOT NULL IDENTITY(1000,1) ,
[CountryId] int NOT NULL ,
[CityName] nvarchar(100) NOT NULL 
)


GO

-- ----------------------------
-- Records of C002_CITY
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [C002_CITY] ON
GO
SET IDENTITY_INSERT [C002_CITY] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for E100_MOVIE
-- ----------------------------
DROP TABLE [E100_MOVIE]
GO
CREATE TABLE [E100_MOVIE] (
[MovieId] int NOT NULL IDENTITY(1000,1) ,
[MovieName] nvarchar(200) NOT NULL ,
[MovieYear] varchar(4) NOT NULL ,
[MovieDescription] nvarchar(MAX) NULL 
)


GO

-- ----------------------------
-- Records of E100_MOVIE
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [E100_MOVIE] ON
GO
SET IDENTITY_INSERT [E100_MOVIE] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for E101_MOVIECATEGORY
-- ----------------------------
DROP TABLE [E101_MOVIECATEGORY]
GO
CREATE TABLE [E101_MOVIECATEGORY] (
[MovieId] int NOT NULL ,
[CategoryId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of E101_MOVIECATEGORY
-- ----------------------------
BEGIN TRANSACTION
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for E99_CATEGORY
-- ----------------------------
DROP TABLE [E99_CATEGORY]
GO
CREATE TABLE [E99_CATEGORY] (
[CategoryId] int NOT NULL IDENTITY(1000,1) ,
[CategoryGroup] int NOT NULL ,
[CategoryGroupDes] nvarchar(100) NULL ,
[CategoryName] nvarchar(20) NULL 
)


GO

-- ----------------------------
-- Records of E99_CATEGORY
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [E99_CATEGORY] ON
GO
SET IDENTITY_INSERT [E99_CATEGORY] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M001_USER_PROFILE
-- ----------------------------
DROP TABLE [M001_USER_PROFILE]
GO
CREATE TABLE [M001_USER_PROFILE] (
[UserId] int NOT NULL IDENTITY(1000,1) ,
[UserName] nvarchar(100) NOT NULL 
)


GO
DBCC CHECKIDENT(N'[M001_USER_PROFILE]', RESEED, 1009)
GO

-- ----------------------------
-- Records of M001_USER_PROFILE
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [M001_USER_PROFILE] ON
GO
INSERT INTO [M001_USER_PROFILE] ([UserId], [UserName]) VALUES (N'1001', N'ca01'), (N'1002', N'ca02'), (N'1005', N'nu0001'), (N'1006', N'nu0002'), (N'1007', N'pu0001'), (N'1008', N'pu0002'), (N'1009', N'pu0003'), (N'1000', N'sa'), (N'1003', N'ua01'), (N'1004', N'ua02')
GO
GO
SET IDENTITY_INSERT [M001_USER_PROFILE] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M051_WEB_MEMBERSHIP
-- ----------------------------
DROP TABLE [M051_WEB_MEMBERSHIP]
GO
CREATE TABLE [M051_WEB_MEMBERSHIP] (
[UserId] int NOT NULL ,
[CreateDate] datetime NOT NULL DEFAULT (getdate()) ,
[ConfirmationToken] nvarchar(128) NULL ,
[IsConfirmed] bit NULL DEFAULT ((0)) ,
[IsActived] bit NULL DEFAULT ((1)) ,
[IsDeleted] bit NULL DEFAULT ((0)) ,
[LastPasswordFailureDate] datetime NULL ,
[PasswordFailuresSinceLastSuccess] int NOT NULL DEFAULT ((0)) ,
[Password] nvarchar(128) NOT NULL ,
[PasswordChangedDate] datetime NULL ,
[PasswordSalt] nvarchar(128) NOT NULL ,
[PasswordVerificationToken] nvarchar(128) NULL ,
[PasswordVerificationTokenExpirationDate] datetime NULL 
)


GO

-- ----------------------------
-- Records of M051_WEB_MEMBERSHIP
-- ----------------------------
BEGIN TRANSACTION
GO
INSERT INTO [M051_WEB_MEMBERSHIP] ([UserId], [CreateDate], [ConfirmationToken], [IsConfirmed], [IsActived], [IsDeleted], [LastPasswordFailureDate], [PasswordFailuresSinceLastSuccess], [Password], [PasswordChangedDate], [PasswordSalt], [PasswordVerificationToken], [PasswordVerificationTokenExpirationDate]) VALUES (N'1000', N'2014-09-10 02:18:55.713', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1001', N'2014-09-08 13:14:33.177', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1002', N'2014-09-08 13:14:39.853', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1003', N'2014-09-08 13:14:47.470', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1004', N'2014-09-08 13:14:54.973', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1005', N'2014-09-08 13:13:13.087', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1006', N'2014-09-08 13:13:36.053', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1007', N'2014-09-08 13:13:51.540', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1008', N'2014-09-08 13:14:09.383', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null), (N'1009', N'2014-09-08 13:14:19.807', null, N'0', N'1', N'0', null, N'0', N'123456', null, N'123456', null, null)
GO
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M061_WEB_ROLES
-- ----------------------------
DROP TABLE [M061_WEB_ROLES]
GO
CREATE TABLE [M061_WEB_ROLES] (
[RoleId] int NOT NULL IDENTITY(1000,1) ,
[RoleName] nvarchar(256) NOT NULL ,
[RoleDescription] nvarchar(MAX) NULL 
)


GO
DBCC CHECKIDENT(N'[M061_WEB_ROLES]', RESEED, 1004)
GO

-- ----------------------------
-- Records of M061_WEB_ROLES
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [M061_WEB_ROLES] ON
GO
INSERT INTO [M061_WEB_ROLES] ([RoleId], [RoleName], [RoleDescription]) VALUES (N'1000', N'ROLE_ADMIN', N'quan ly admins'), (N'1001', N'ROLE_CONTENT_ADMIN', N'bo sung noi dung'), (N'1002', N'ROLE_USER_ADMIN', N'quan ly user'), (N'1003', N'ROLE_USERS', N'nguoi dung binh thuong'), (N'1004', N'ROLE_PREMIUM_USERS', N'nguoi dung tra phis')
GO
GO
SET IDENTITY_INSERT [M061_WEB_ROLES] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M062_WEB_USER_IN_ROLES
-- ----------------------------
DROP TABLE [M062_WEB_USER_IN_ROLES]
GO
CREATE TABLE [M062_WEB_USER_IN_ROLES] (
[UserId] int NOT NULL ,
[RoleId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of M062_WEB_USER_IN_ROLES
-- ----------------------------
BEGIN TRANSACTION
GO
INSERT INTO [M062_WEB_USER_IN_ROLES] ([UserId], [RoleId]) VALUES (N'1000', N'1000'), (N'1001', N'1001'), (N'1002', N'1001'), (N'1003', N'1002'), (N'1004', N'1002'), (N'1005', N'1003'), (N'1006', N'1003'), (N'1007', N'1004'), (N'1008', N'1004'), (N'1009', N'1004')
GO
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M101_DIRECTOR
-- ----------------------------
DROP TABLE [M101_DIRECTOR]
GO
CREATE TABLE [M101_DIRECTOR] (
[DirectorId] int NOT NULL IDENTITY(1000,1) ,
[DirectorName] varchar(100) NOT NULL ,
[DirectorGender] char(1) NULL ,
[DirectorBirth] datetime NULL ,
[DirectorNationality] int NULL ,
[DirectorHomeCountry] int NULL 
)


GO

-- ----------------------------
-- Records of M101_DIRECTOR
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [M101_DIRECTOR] ON
GO
SET IDENTITY_INSERT [M101_DIRECTOR] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M102_ACTOR
-- ----------------------------
DROP TABLE [M102_ACTOR]
GO
CREATE TABLE [M102_ACTOR] (
[ActorId] int NOT NULL IDENTITY(1000,1) ,
[ActorName] varchar(100) NOT NULL ,
[ActorGender] char(1) NULL ,
[ActorBirth] datetime NULL ,
[ActorNationality] int NULL ,
[ActorHomeCountry] int NULL 
)


GO

-- ----------------------------
-- Records of M102_ACTOR
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [M102_ACTOR] ON
GO
SET IDENTITY_INSERT [M102_ACTOR] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M111_MOVIEDIRECTOR
-- ----------------------------
DROP TABLE [M111_MOVIEDIRECTOR]
GO
CREATE TABLE [M111_MOVIEDIRECTOR] (
[DirectorId] int NOT NULL ,
[MovieId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of M111_MOVIEDIRECTOR
-- ----------------------------
BEGIN TRANSACTION
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for M112_ACTORMOVIE
-- ----------------------------
DROP TABLE [M112_ACTORMOVIE]
GO
CREATE TABLE [M112_ACTORMOVIE] (
[ActorId] int NOT NULL ,
[MovieId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of M112_ACTORMOVIE
-- ----------------------------
BEGIN TRANSACTION
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P100_CINEMA
-- ----------------------------
DROP TABLE [P100_CINEMA]
GO
CREATE TABLE [P100_CINEMA] (
[CinemaId] int NOT NULL IDENTITY(1000,1) ,
[CinemaName] nvarchar(200) NOT NULL ,
[CityId] int NOT NULL ,
[CinemaAddress] nvarchar(200) NOT NULL 
)


GO

-- ----------------------------
-- Records of P100_CINEMA
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P100_CINEMA] ON
GO
SET IDENTITY_INSERT [P100_CINEMA] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P101_CINEMAROOM
-- ----------------------------
DROP TABLE [P101_CINEMAROOM]
GO
CREATE TABLE [P101_CINEMAROOM] (
[RoomId] int NOT NULL IDENTITY(1000,1) ,
[RoomName] varchar(10) NOT NULL ,
[CinemaId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of P101_CINEMAROOM
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P101_CINEMAROOM] ON
GO
SET IDENTITY_INSERT [P101_CINEMAROOM] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P102_CINEMAROOMSEAT
-- ----------------------------
DROP TABLE [P102_CINEMAROOMSEAT]
GO
CREATE TABLE [P102_CINEMAROOMSEAT] (
[SeatId] int NOT NULL IDENTITY(1000,1) ,
[SeatName] varchar(10) NOT NULL ,
[RoomId] int NOT NULL 
)


GO

-- ----------------------------
-- Records of P102_CINEMAROOMSEAT
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P102_CINEMAROOMSEAT] ON
GO
SET IDENTITY_INSERT [P102_CINEMAROOMSEAT] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P103_CINEMATIMESLOT
-- ----------------------------
DROP TABLE [P103_CINEMATIMESLOT]
GO
CREATE TABLE [P103_CINEMATIMESLOT] (
[SlotId] int NOT NULL IDENTITY(1000,1) ,
[SlotName] varchar(10) NOT NULL ,
[StartTime] time(7) NOT NULL ,
[EndTime] time(7) NOT NULL 
)


GO

-- ----------------------------
-- Records of P103_CINEMATIMESLOT
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P103_CINEMATIMESLOT] ON
GO
SET IDENTITY_INSERT [P103_CINEMATIMESLOT] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P111_MOVIERUN
-- ----------------------------
DROP TABLE [P111_MOVIERUN]
GO
CREATE TABLE [P111_MOVIERUN] (
[RunId] int NOT NULL IDENTITY(1000,1) ,
[MovieId] int NOT NULL ,
[RoomId] int NOT NULL ,
[ShowDay] date NOT NULL ,
[TimeSlot] int NOT NULL 
)


GO

-- ----------------------------
-- Records of P111_MOVIERUN
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P111_MOVIERUN] ON
GO
SET IDENTITY_INSERT [P111_MOVIERUN] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Table structure for P112_MOVIETICKET
-- ----------------------------
DROP TABLE [P112_MOVIETICKET]
GO
CREATE TABLE [P112_MOVIETICKET] (
[TicketId] int NOT NULL IDENTITY(1000,1) ,
[RunId] int NOT NULL ,
[SeatId] int NOT NULL ,
[TicketPrice] float(53) NOT NULL 
)


GO

-- ----------------------------
-- Records of P112_MOVIETICKET
-- ----------------------------
BEGIN TRANSACTION
GO
SET IDENTITY_INSERT [P112_MOVIETICKET] ON
GO
SET IDENTITY_INSERT [P112_MOVIETICKET] OFF
GO
COMMIT TRANSACTION
GO

-- ----------------------------
-- Indexes structure for table C001_COUNTRY
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table C001_COUNTRY
-- ----------------------------
ALTER TABLE [C001_COUNTRY] ADD PRIMARY KEY ([CountryId])
GO

-- ----------------------------
-- Uniques structure for table C001_COUNTRY
-- ----------------------------
ALTER TABLE [C001_COUNTRY] ADD UNIQUE ([CountryName] ASC)
GO

-- ----------------------------
-- Indexes structure for table C002_CITY
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table C002_CITY
-- ----------------------------
ALTER TABLE [C002_CITY] ADD PRIMARY KEY ([CityId])
GO

-- ----------------------------
-- Uniques structure for table C002_CITY
-- ----------------------------
ALTER TABLE [C002_CITY] ADD UNIQUE ([CountryId] ASC, [CityName] ASC)
GO

-- ----------------------------
-- Indexes structure for table E100_MOVIE
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table E100_MOVIE
-- ----------------------------
ALTER TABLE [E100_MOVIE] ADD PRIMARY KEY ([MovieId])
GO

-- ----------------------------
-- Indexes structure for table E101_MOVIECATEGORY
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table E101_MOVIECATEGORY
-- ----------------------------
ALTER TABLE [E101_MOVIECATEGORY] ADD PRIMARY KEY ([MovieId], [CategoryId])
GO

-- ----------------------------
-- Indexes structure for table E99_CATEGORY
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table E99_CATEGORY
-- ----------------------------
ALTER TABLE [E99_CATEGORY] ADD PRIMARY KEY ([CategoryId])
GO

-- ----------------------------
-- Uniques structure for table E99_CATEGORY
-- ----------------------------
ALTER TABLE [E99_CATEGORY] ADD UNIQUE ([CategoryGroup] ASC, [CategoryName] ASC)
GO

-- ----------------------------
-- Indexes structure for table M001_USER_PROFILE
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M001_USER_PROFILE
-- ----------------------------
ALTER TABLE [M001_USER_PROFILE] ADD PRIMARY KEY ([UserId])
GO

-- ----------------------------
-- Uniques structure for table M001_USER_PROFILE
-- ----------------------------
ALTER TABLE [M001_USER_PROFILE] ADD UNIQUE ([UserName] ASC)
GO

-- ----------------------------
-- Indexes structure for table M051_WEB_MEMBERSHIP
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M051_WEB_MEMBERSHIP
-- ----------------------------
ALTER TABLE [M051_WEB_MEMBERSHIP] ADD PRIMARY KEY ([UserId])
GO

-- ----------------------------
-- Indexes structure for table M061_WEB_ROLES
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M061_WEB_ROLES
-- ----------------------------
ALTER TABLE [M061_WEB_ROLES] ADD PRIMARY KEY ([RoleId])
GO

-- ----------------------------
-- Uniques structure for table M061_WEB_ROLES
-- ----------------------------
ALTER TABLE [M061_WEB_ROLES] ADD UNIQUE ([RoleName] ASC)
GO

-- ----------------------------
-- Indexes structure for table M062_WEB_USER_IN_ROLES
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M062_WEB_USER_IN_ROLES
-- ----------------------------
ALTER TABLE [M062_WEB_USER_IN_ROLES] ADD PRIMARY KEY ([UserId], [RoleId])
GO

-- ----------------------------
-- Indexes structure for table M101_DIRECTOR
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M101_DIRECTOR
-- ----------------------------
ALTER TABLE [M101_DIRECTOR] ADD PRIMARY KEY ([DirectorId])
GO

-- ----------------------------
-- Indexes structure for table M102_ACTOR
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M102_ACTOR
-- ----------------------------
ALTER TABLE [M102_ACTOR] ADD PRIMARY KEY ([ActorId])
GO

-- ----------------------------
-- Indexes structure for table M111_MOVIEDIRECTOR
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M111_MOVIEDIRECTOR
-- ----------------------------
ALTER TABLE [M111_MOVIEDIRECTOR] ADD PRIMARY KEY ([DirectorId], [MovieId])
GO

-- ----------------------------
-- Indexes structure for table M112_ACTORMOVIE
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table M112_ACTORMOVIE
-- ----------------------------
ALTER TABLE [M112_ACTORMOVIE] ADD PRIMARY KEY ([ActorId], [MovieId])
GO

-- ----------------------------
-- Indexes structure for table P100_CINEMA
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P100_CINEMA
-- ----------------------------
ALTER TABLE [P100_CINEMA] ADD PRIMARY KEY ([CinemaId])
GO

-- ----------------------------
-- Uniques structure for table P100_CINEMA
-- ----------------------------
ALTER TABLE [P100_CINEMA] ADD UNIQUE ([CinemaName] ASC, [CityId] ASC, [CinemaAddress] ASC)
GO

-- ----------------------------
-- Indexes structure for table P101_CINEMAROOM
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P101_CINEMAROOM
-- ----------------------------
ALTER TABLE [P101_CINEMAROOM] ADD PRIMARY KEY ([RoomId])
GO

-- ----------------------------
-- Uniques structure for table P101_CINEMAROOM
-- ----------------------------
ALTER TABLE [P101_CINEMAROOM] ADD UNIQUE ([CinemaId] ASC, [RoomName] ASC)
GO

-- ----------------------------
-- Indexes structure for table P102_CINEMAROOMSEAT
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P102_CINEMAROOMSEAT
-- ----------------------------
ALTER TABLE [P102_CINEMAROOMSEAT] ADD PRIMARY KEY ([SeatId])
GO

-- ----------------------------
-- Uniques structure for table P102_CINEMAROOMSEAT
-- ----------------------------
ALTER TABLE [P102_CINEMAROOMSEAT] ADD UNIQUE ([RoomId] ASC, [SeatName] ASC)
GO

-- ----------------------------
-- Indexes structure for table P103_CINEMATIMESLOT
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P103_CINEMATIMESLOT
-- ----------------------------
ALTER TABLE [P103_CINEMATIMESLOT] ADD PRIMARY KEY ([SlotId])
GO

-- ----------------------------
-- Uniques structure for table P103_CINEMATIMESLOT
-- ----------------------------
ALTER TABLE [P103_CINEMATIMESLOT] ADD UNIQUE ([SlotName] ASC)
GO
ALTER TABLE [P103_CINEMATIMESLOT] ADD UNIQUE ([StartTime] ASC, [EndTime] ASC)
GO

-- ----------------------------
-- Indexes structure for table P111_MOVIERUN
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P111_MOVIERUN
-- ----------------------------
ALTER TABLE [P111_MOVIERUN] ADD PRIMARY KEY ([RunId])
GO

-- ----------------------------
-- Uniques structure for table P111_MOVIERUN
-- ----------------------------
ALTER TABLE [P111_MOVIERUN] ADD UNIQUE ([MovieId] ASC, [RoomId] ASC, [ShowDay] ASC, [TimeSlot] ASC)
GO

-- ----------------------------
-- Indexes structure for table P112_MOVIETICKET
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table P112_MOVIETICKET
-- ----------------------------
ALTER TABLE [P112_MOVIETICKET] ADD PRIMARY KEY ([TicketId])
GO

-- ----------------------------
-- Uniques structure for table P112_MOVIETICKET
-- ----------------------------
ALTER TABLE [P112_MOVIETICKET] ADD UNIQUE ([RunId] ASC, [SeatId] ASC)
GO
